package com.rbtnet.ssc;

import redis.clients.jedis.Jedis;

public class RedisService {
	
	private static RedisService instance;
	private static Jedis jedis; 

	public static RedisService instance(){
		if(instance == null){
			instance = new RedisService();
		}
		if(jedis == null){
			jedis = new Jedis("localhost");
			jedis.auth("123456");
		}
		return instance;
	}
	
	public String set(String key, String value){
		return jedis.set(key, value);
	}
	
	public Long incr(String key){
		return jedis.incr(key);
	}
	
	public Long decr(String key){
		return jedis.decr(key);
	}
}
